/**
 * 
 */
package org.seckill.dto;

import org.seckill.entry.SuccessSeckilled;
import org.seckill.enums.SeckillStateEnum;

/**
 * 秒杀结果
 * @author yue
 * 2016年5月29日 上午11:08:46
 */
public class SeckillExecution {
	
	/* 秒杀单 */
	private long seckillId;
	/* 状态  */
	private int state;
	/* 状态描述  */
	private String stateInfo;
	/* 秒杀成功对象  */
	private SuccessSeckilled successSeckilled;
	
	
	public SeckillExecution(long seckillId, SeckillStateEnum seckillEnum) {
		this.seckillId = seckillId;
		this.state = seckillEnum.getState();
		this.stateInfo = seckillEnum.getStateInfo();
	}
	
	public SeckillExecution(long seckillId, SeckillStateEnum seckillEnum, SuccessSeckilled successSeckilled) {
		this.seckillId = seckillId;
		this.state = seckillEnum.getState();
		this.stateInfo = seckillEnum.getStateInfo();
		this.successSeckilled = successSeckilled;
	}


	public long getSeckillId() {
		return seckillId;
	}
	public void setSeckillId(long seckillId) {
		this.seckillId = seckillId;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public String getStateInfo() {
		return stateInfo;
	}
	public void setStateInfo(String stateInfo) {
		this.stateInfo = stateInfo;
	}
	public SuccessSeckilled getSuccessSeckilled() {
		return successSeckilled;
	}
	public void setSuccessSeckilled(SuccessSeckilled successSeckilled) {
		this.successSeckilled = successSeckilled;
	}

	@Override
	public String toString() {
		return "SeckillExecution [seckillId=" + seckillId + ", state=" + state
				+ ", stateInfo=" + stateInfo + ", successSeckilled="
				+ successSeckilled + "]";
	}
}
